package SPRING_AUTHC_MISSING;

public class Fixed_02 {
    @Configuration
    @EnableWebSecurity
    public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
        @Override
        protected void configure(HttpSecurity http) throws Exception {

            http.authorizeRequests()
                    .antMatchers(HttpMethod.POST,"/setting/admin/*").permitAll()
                    .antMatchers(HttpMethod.POST,"/api-docs ").anonymous()
                    .antMatchers("/setting/properties/*").hasAnyRole("ADMIN")
                    .antMatchers(HttpMethod.PUT,"/profile").authenticated()
                    .and().httpBasic();
        }
    }
